import { UnwrapRef } from "vue";

export enum OrderRule {
  DESC = "descending",
  ASC = "ascending",
}

export type TableRecord = Record<string, any>;
export type SearchModel = Record<string, any>;

export interface PaginationParam<T extends SearchModel> {
  pageNum?: number;
  model?: T | {};
  order?: OrderRule | "";
  pageSize?: number;
  sort?: string;
  [key: string]: any;
}

export interface PaginationResult<T extends TableRecord> {
  pageNum: number;
  pages: number;
  pageSize: number;
  total: number;
  list: UnwrapRef<T[]>;
  rows: UnwrapRef<T[]>;
}

export type DeleteParams = {
  idKey?: string;
  idValue?: string | number | string[] | number[];
  urlSuffix?: string;
};

export type ID = string | number;

export enum UploadFileType {
  IMAGE = "IMAGE",
  VIDEO = "VIDEO",
  AUDIO = "AUDIO",
  DOC = "DOC",
  OTHER = "OTHER",
}

export interface MapLocation {
  latitude: string;
  longitude: string;
}
